<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-tool/gc/backend.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('backend_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">backend.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="backend_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef BACKEND_H__</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define BACKEND_H__</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;pthread.h&gt;</span>  </div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="garble__circuit_8h.html">garble_circuit.h</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;block.h&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="class_backend.html">    8</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_backend.html">Backend</a> { <span class="keyword">public</span>:</div><div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="class_backend.html#a8071a023768eccaef6b6050440d3b75e">    9</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_backend.html#a8071a023768eccaef6b6050440d3b75e">cur_party</a>;</div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="class_backend.html#aae71d4edb4470a4593c98073c506244c">   10</a></span>&#160;    void (*<a class="code" href="class_backend.html#aae71d4edb4470a4593c98073c506244c">Feed_internal</a>)(<a class="code" href="class_backend.html">Backend</a>* be, int, <a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> * label, <span class="keyword">const</span> <span class="keywordtype">bool</span>*, <span class="keywordtype">int</span> length);</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="class_backend.html#a0c4383b3a03d604bae7dcf05efc66f74">   11</a></span>&#160;    void (*<a class="code" href="class_backend.html#a0c4383b3a03d604bae7dcf05efc66f74">Reveal_internal</a>)(<a class="code" href="class_backend.html">Backend</a>* be, <span class="keywordtype">bool</span>*, int, <span class="keyword">const</span> <a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> * label, <span class="keywordtype">int</span> length);</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_backend.html#a99c19c1e1b66bd835145fddcade401c9">   12</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_backend.html#a99c19c1e1b66bd835145fddcade401c9">Feed</a>(<a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> * lbls, <span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>, <span class="keyword">const</span> <span class="keywordtype">bool</span>* b, <span class="keywordtype">int</span> nel) {</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;        this-&gt;<a class="code" href="class_backend.html#aae71d4edb4470a4593c98073c506244c">Feed_internal</a>(<span class="keyword">this</span>, party, lbls, b, nel);</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    }</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="class_backend.html#a209c8aa773aacb4960839fb417d10345">   15</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_backend.html#a209c8aa773aacb4960839fb417d10345">Reveal</a>(<span class="keywordtype">bool</span>*out, <span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>, <span class="keyword">const</span> <a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *lbls, <span class="keywordtype">int</span> nel) {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        this-&gt;<a class="code" href="class_backend.html#a0c4383b3a03d604bae7dcf05efc66f74">Reveal_internal</a>(<span class="keyword">this</span>, out, party, lbls, nel); </div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    }</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_backend.html#a573a812411c15c9a5c20e3a127e83686">   18</a></span>&#160;    <a class="code" href="class_backend.html#a573a812411c15c9a5c20e3a127e83686">Backend</a>(<span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>) {</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        cur_party = <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    }</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;};</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifdef THREADING</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">extern</span> __thread <a class="code" href="class_backend.html">Backend</a>* <a class="code" href="backend_8h.html#ad9476de428d45c84de795f4157a9dc10">local_backend</a>;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">extern</span> __thread <a class="code" href="class_garble_circuit.html">GarbleCircuit</a>* <a class="code" href="backend_8h.html#a293f7f73b0f19aaf7e67212ddc526fed">local_gc</a>;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">extern</span> <a class="code" href="class_backend.html">Backend</a>* <a class="code" href="backend_8h.html#ad9476de428d45c84de795f4157a9dc10">local_backend</a>;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keyword">extern</span>  <a class="code" href="class_garble_circuit.html">GarbleCircuit</a>* <a class="code" href="backend_8h.html#a293f7f73b0f19aaf7e67212ddc526fed">local_gc</a>;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#endif// BACKEND_H__</span></div><div class="ttc" id="class_backend_html_a8071a023768eccaef6b6050440d3b75e"><div class="ttname"><a href="class_backend.html#a8071a023768eccaef6b6050440d3b75e">Backend::cur_party</a></div><div class="ttdeci">int cur_party</div><div class="ttdef"><b>Definition:</b> backend.h:9</div></div>
<div class="ttc" id="backend_8h_html_ad9476de428d45c84de795f4157a9dc10"><div class="ttname"><a href="backend_8h.html#ad9476de428d45c84de795f4157a9dc10">local_backend</a></div><div class="ttdeci">Backend * local_backend</div><div class="ttdef"><b>Definition:</b> backend.cpp:7</div></div>
<div class="ttc" id="garble_2block_8h_html_a65abbf31b0a30290189cdb5059b5f785"><div class="ttname"><a href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a></div><div class="ttdeci">__m128i block</div><div class="ttdef"><b>Definition:</b> block.h:8</div></div>
<div class="ttc" id="config_8h_html"><div class="ttname"><a href="config_8h.html">config.h</a></div></div>
<div class="ttc" id="class_backend_html_a573a812411c15c9a5c20e3a127e83686"><div class="ttname"><a href="class_backend.html#a573a812411c15c9a5c20e3a127e83686">Backend::Backend</a></div><div class="ttdeci">Backend(int party)</div><div class="ttdef"><b>Definition:</b> backend.h:18</div></div>
<div class="ttc" id="class_backend_html_a209c8aa773aacb4960839fb417d10345"><div class="ttname"><a href="class_backend.html#a209c8aa773aacb4960839fb417d10345">Backend::Reveal</a></div><div class="ttdeci">void Reveal(bool *out, int party, const block *lbls, int nel)</div><div class="ttdef"><b>Definition:</b> backend.h:15</div></div>
<div class="ttc" id="class_backend_html_a99c19c1e1b66bd835145fddcade401c9"><div class="ttname"><a href="class_backend.html#a99c19c1e1b66bd835145fddcade401c9">Backend::Feed</a></div><div class="ttdeci">void Feed(block *lbls, int party, const bool *b, int nel)</div><div class="ttdef"><b>Definition:</b> backend.h:12</div></div>
<div class="ttc" id="backend_8h_html_a293f7f73b0f19aaf7e67212ddc526fed"><div class="ttname"><a href="backend_8h.html#a293f7f73b0f19aaf7e67212ddc526fed">local_gc</a></div><div class="ttdeci">GarbleCircuit * local_gc</div><div class="ttdef"><b>Definition:</b> backend.cpp:8</div></div>
<div class="ttc" id="class_backend_html_a0c4383b3a03d604bae7dcf05efc66f74"><div class="ttname"><a href="class_backend.html#a0c4383b3a03d604bae7dcf05efc66f74">Backend::Reveal_internal</a></div><div class="ttdeci">void(* Reveal_internal)(Backend *be, bool *, int, const block *label, int length)</div><div class="ttdef"><b>Definition:</b> backend.h:11</div></div>
<div class="ttc" id="class_backend_html"><div class="ttname"><a href="class_backend.html">Backend</a></div><div class="ttdef"><b>Definition:</b> backend.h:8</div></div>
<div class="ttc" id="class_backend_html_aae71d4edb4470a4593c98073c506244c"><div class="ttname"><a href="class_backend.html#aae71d4edb4470a4593c98073c506244c">Backend::Feed_internal</a></div><div class="ttdeci">void(* Feed_internal)(Backend *be, int, block *label, const bool *, int length)</div><div class="ttdef"><b>Definition:</b> backend.h:10</div></div>
<div class="ttc" id="garble__circuit_8h_html"><div class="ttname"><a href="garble__circuit_8h.html">garble_circuit.h</a></div></div>
<div class="ttc" id="class_garble_circuit_html"><div class="ttname"><a href="class_garble_circuit.html">GarbleCircuit</a></div><div class="ttdef"><b>Definition:</b> garble_circuit.h:7</div></div>
<div class="ttc" id="input-check-malicious_8cpp_html_aefdd5aa9f02e7cb8d21ea22b0e6b03df"><div class="ttname"><a href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a></div><div class="ttdeci">int party</div><div class="ttdef"><b>Definition:</b> input-check-malicious.cpp:12</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_eec959d81771dc8b1a750b834e1341eb.html">emp-tool</a></li><li class="navelem"><a class="el" href="dir_753dd0b08657245813d151abe49cc74f.html">gc</a></li><li class="navelem"><a class="el" href="backend_8h.html">backend.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
